import { Node, mergeAttributes } from "@tiptap/core";

export const Code = Node.create({
  name: "code",
  group: "block",
  content: "inline*",

  parseHTML() {
    return [
      {
        tag: "pre",
      },
    ];
  },

  renderHTML({ HTMLAttributes }) {
    return [
      "pre",
      mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
      0,
    ];
  },
});
